Embodiments of the present invention relate to computer systems and more particularly to effective use of resources of such a system.
Computer systems execute various software programs using different hardware resources of the system, including a processor, memory and other such components. A processor itself includes various resources including one or more execution cores, cache memories, hardware registers, and the like. Certain processors also include hardware performance counters that are used to count events or actions occurring during program execution. For example, certain processors include counters for counting memory accesses, cache misses, instructions executed and the like. Additionally, performance monitors may also exist in software to monitor execution of one or more software programs.
Together, such counters and monitors can be used according to at least two usage models. First, they may be used during compilation and other optimization activities to improve code execution based upon profile information obtained during program execution. Second, upon occurrence of an event in a counter or monitor during program execution, one or more helper threads may be called. Such helper threads are software routines that are called by a calling program to improve execution, such as to prefetch data from memory or perform another such activity to improve program execution.
Oftentimes, these resources are used inefficiently, and furthermore use of such resources in the different usage models can conflict. A need thus exists for improved manners of obtaining and using monitors and performance information for use in these different usage models.